package com.fs.servlet;

import java.io.IOException;
import java.io.PrintWriter;
import java.util.List;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.http.HttpSession;

import com.fs.dao.ProductDao;
import com.fs.dao.ProductDetailsDao;
import com.fs.entity.Product;
@WebServlet("/index.do")
public class IndexServlet extends HttpServlet{
	
	@Override
	protected void doGet(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		doPost(req, resp);
	}
	@Override
	protected void doPost(HttpServletRequest req, HttpServletResponse resp)
			throws ServletException, IOException {
		// TODO Auto-generated method stub
		ProductDao prodao=new ProductDao();
		List<Product> prolist=prodao.getProductListAll();
		req.setAttribute("prolist",prolist );
		req.getRequestDispatcher("index.jsp").forward(req, resp);
		
	}

}
